package Componente;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

public class CompEtiqueta extends JLabel
{
   public CompEtiqueta(String texto,JPanel panel,String ubicacion)
   {
      this (texto,panel,ubicacion, " ");
   }
   
   public CompEtiqueta(String texto,JPanel panel,String ubicacion,String pRuta)
   {
      super(texto);
      ImageIcon icon=new ImageIcon(pRuta);
      this.setIcon(icon);
      if(pRuta =="") this.setText("Ingrese Imagen");
      this.setHorizontalAlignment(SwingConstants.CENTER);
      panel.add(this,ubicacion);
   }
}
